
*Input Data
forvalues ii=1(1)7 {
	import excel "$root/Data/Original/Auswertung_Personenwagen_SUSA-1935_20190628_`ii'.xlsx",  firstrow clear
	tempfile part_`ii'
	save `part_`ii'', replace
}

clear
forvalues ii=1(1)7 {
	append using `part_`ii''
}

* replace (null) values
foreach var of varlist alt_* {
	replace `var'="" if `var'=="(null)"
}

* destring
destring alt_stammnummer alt_leistung_kw, force replace

*drop the two observations with the same stammnummer
duplicates tag stammnummer, g(duplicates)

duplicates drop stammnummer, force
drop duplicates

gen year = year(datum_1iv)
order year

preserve
	keep year stammnummer hauptname vorname strasse plz ort
	save "$root/Data/Original/EV_namelist_new.dta", replace
restore

drop hauptname vorname strasse plz ort
save "$root/Data/Original/EV_alldata_new.dta", replace



	
